@extends('admin.layout')

@section('content')
    <div class="console-content">

        <div class="page-header">
            <h2 id="nav">添加用户</h2>
        </div>

        <div class="well bs-component">
            @form(['url' => isset($agent)? admin_url('agent/update/'.$agent->id): admin_url('agent/create'), 'method' => 'post', 'class' => 'form-horizontal'])
            @col_input('text','name',$errors,'*授权名',isset($agent) ? $agent->name : old('name'), ['placeholder' => '例如：xx市代理'])
            @col_input('text','wechat',$errors,'*微信号',isset($agent) ? $agent->wechat : old('wechat'),['placeholder' => '代理登录的账号'])
            @col_input('password','password',$errors,'*登录密码',isset($agent) ? $agent->password : old('password') ,['placeholder' => '登录密码'])
            @col_input('password','repass',$errors,'确认密码',isset($agent) ? $agent->password : old('password'),['placeholder' => '确认密码'])
            @col_input('text','phone',$errors,'*手机号',isset($agent) ? $agent->phone : old('phone'),['placeholder' => '手机号'])
            @col_input('text','id_number',$errors,'*身份证号',isset($agent) ? $agent->id_number : old('id_number'),['placeholder' => '身份证号'])
            @col_input('text','address',$errors,'*收货地址',isset($agent) ? $agent->address : old('address'),['placeholder' => '收货地址'])
            @col_select('status', [1 => '待审核', 2 => '通过审核', 3 => '禁用'], $errors, '状态 ', isset($agent) ? $agent->status : old('status'),['placeholder' => '状态'])
            @col_submit('提交')
            @endform
        </div>

    </div>
@endsection